package com.maschinenstuermer.profiler.test.stub;

import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.InvalidTransactionException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;

public class TransactionManagerStub implements TransactionManager {
	private TransactionStub transactionStub;

	public void begin() throws NotSupportedException, SystemException {
		transactionStub = new TransactionStub();
	}

	public void commit() throws HeuristicMixedException,
			HeuristicRollbackException, IllegalStateException,
			RollbackException, SecurityException, SystemException {
		transactionStub.commit();
	}

	public int getStatus() throws SystemException {
		return transactionStub.getStatus();
	}

	public Transaction getTransaction() throws SystemException {
		return transactionStub;
	}

	public void resume(Transaction arg0) throws IllegalStateException,
			InvalidTransactionException, SystemException {
	}

	public void rollback() throws IllegalStateException, SecurityException,
			SystemException {
		transactionStub.rollback();
	}

	public void setRollbackOnly() throws IllegalStateException, SystemException {
	}

	public void setTransactionTimeout(int arg0) throws SystemException {
	}

	public Transaction suspend() throws SystemException {
		return null;
	}
}
